package collect;

import java.util.ArrayList;
import java.util.List;

/**
 * 泛型类
 * @author galne
 */
public class BookTest {
    public static void main(String[] args) {
        BookCategory cate1 = new BookCategory(1, "数据库");
        BookCategory cate2 = new BookCategory(2, "程序设计");
        BookCategory cate3 = new BookCategory(3, "平面设计");

        BookInfo book1 = new BookInfo(1, "细说 Java 编程", 25, "张晓玲", "2012-01-01");
        BookInfo book2 = new BookInfo(2, "影视后期处理宝典", 78, "刘水波", "2012-10-05");
        BookInfo book3 = new BookInfo(3, "MySQL 从入门到精通", 41.9, "王志亮", "2012-3-2");
        BookInfo book4 = new BookInfo(4, "Java 从入门到精通", 27.8, "陈奚静", "2012-11-01");
        BookInfo book5 = new BookInfo(5, "SQL Server 一百例", 68.9, "张晓玲", "2012-01-01");
    
        // 向类别 1 添加图书
        List<BookInfo> list1 = new ArrayList<BookInfo>();
        list1.add(book1);
        list1.add(book4);

        // 向类别 2 添加图书
        List<BookInfo> list2 = new ArrayList<BookInfo>();
        list2.add(book3);
        list2.add(book5);

        // 向类别 3 添加图书
        List<BookInfo> list3 = new ArrayList<BookInfo>();
        list3.add(book2);

        BookCategoryDao.categoryMap.put(cate1, list1);
        BookCategoryDao.categoryMap.put(cate2, list2);
        BookCategoryDao.categoryMap.put(cate3, list3);
        BookCategoryDao.printDeptmentInfo();

    }
}
